package com.liang.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liang.entity.CKaoshi;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 李昂
 * @since 2020-11-30
 */
public interface CKaoshiMapper extends BaseMapper<CKaoshi> {
    //    @Select(value = "select c.clazz , c.title , avg(score) score from c_kaoshi as c group by title order by clazz desc")
    List<CKaoshi> showAllKaoshi(@Param("title") String title);

    //获取考试成绩 平均分  最高分  最低分
    List<CKaoshi> GroupKaoshi();

    // 显示本次考试成员的成绩
    @Select("select name,sno,score from c_kaoshi where title = #{title}")
    List<CKaoshi> showScore(@Param("title") String title);

    //根据学号查询个人考试成绩
    @Select("select score ,title,time from c_kaoshi where sno = #{sno}")
    List<CKaoshi> getGradeBySno(@Param("sno") String sno);


}
